package com.shrcl.engineerprocess.domain.impl;

import com.shrcl.engineerprocess.domain.TSCServiceItem;
import com.shrcl.engineerprocess.domain.proxy.TSCServiceItemProxy;
import edu.fudan.mylang.pf.BaseModelObject;
import edu.fudan.mylang.pf.IObjectFactory;
import javax.persistence.DiscriminatorColumn;
import javax.persistence.DiscriminatorValue;
import javax.persistence.Entity;
import javax.persistence.Table;
import org.eclipse.xtext.xbase.lib.Procedures.Procedure1;
import org.hibernate.annotations.DiscriminatorOptions;

@Entity
@DiscriminatorValue("TSCSERVICEITEM_TYPE")
@DiscriminatorOptions(force = true)
@DiscriminatorColumn(length = 64)
@Table(name = "tscserviceitem")
public class TSCServiceItemImpl extends BaseModelObject implements TSCServiceItem {
  public TSCServiceItemImpl() {
    super();
  }
  
  private String name;
  
  public String getName() {
    return this.name;
  }
  
  public TSCServiceItem setName(final String name) {
    this.name = name;
    return this;			
    
  }
  
  public String getEntityName() {
    return this.name;
  }
  
  public static TSCServiceItem create(final IObjectFactory objectFactory) {
    com.shrcl.engineerprocess.domain.TSCServiceItem tSCServiceItem = new com.shrcl.engineerprocess.domain.impl.TSCServiceItemImpl(
    );
    objectFactory.create(tSCServiceItem);
    return tSCServiceItem;			
    
  }
  
  public static TSCServiceItem createTSCServiceItemImpl(final IObjectFactory objectFactory, final Procedure1<TSCServiceItem> init) {
    com.shrcl.engineerprocess.domain.TSCServiceItem tSCServiceItem = new com.shrcl.engineerprocess.domain.impl.TSCServiceItemImpl(
    );
    objectFactory.create(tSCServiceItem);
    init.apply(tSCServiceItem);
    
    return tSCServiceItem;			
    
  }
  
  public TSCServiceItemProxy toProxy() {
    com.shrcl.engineerprocess.domain.proxy.TSCServiceItemProxy proxy = new com.shrcl.engineerprocess.domain.proxy.TSCServiceItemProxy();
    proxy.setId(this.getId());
    if(this instanceof edu.fudan.mylang.pf.INamedModelObject){
    	proxy.setName(((edu.fudan.mylang.pf.INamedModelObject)this).getEntityName());
    }
    return proxy;
    
  }
}
